home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / edit / notepa.zip / NOTEPAD4.TXT < prev   
Text File  |  1990-07-23  |  4KB  |  82 lines

  1. Notepad4
  2. --------
  3.  
  4. Notepad4 is a small and simple program which is designed to make
  5. it easier to use Notepad as a program editor under Microsoft Windows.
  6. It starts up Notepad, and then sends a message to the Notepad window
  7. resetting the tab stops to be every four characters.
  8.  
  9. Notepad normally has tab stops set at every eight characters.  For
  10. the purposes of developing C language programs, eight is really too
  11. large.  After a few levels of indenting, program lines are located
  12. so far to the right that they have to be made very short in order to
  13. fit.  Four-space tab stops allow you to indent freely and still give
  14. you a reasonable amount of space for writing lines of code.  Notepad4's
  15. only function is to change the tab stops in the Notepad program.
  16.  
  17. Notepad has another deficiency when used as a program editor.  It
  18. defaults to looking for files of the form *.TXT when you use its
  19. "Open..." command.  I have found an easy way to improve this behavior,
  20. though.
  21.  
  22. Make a backup copy of the NOTEPAD.EXE that comes with Windows.  Run
  23. Windows Write and open up NOTEPAD.EXE.  Although Write is designed as
  24. a text editor, it will allow you to open binary files like this one.
  25. Specify "No Conversion" when Write asks you if you want to convert
  26. the file to Write format.  Write will open the file and display it
  27. as mostly a lot of non-printable characters.
  28.  
  29. Use Write's "Find..." command to search for the string "*.EXE".  When
  30. you find it, delete that string and replace it with "*.*  ".  That's
  31. "star dot star space space".  It's important that you don't replace
  32. it with just "*.*".  You have to add the two spaces so that the whole
  33. string is still exactly five characters long.
  34.  
  35. Search for "*.EXE" again; there are two occurances in the file.  Replace
  36. the second one with "*.*  " also.  Then save the file.
  37.  
  38. The resulting Notepad will work just like the original Notepad,
  39. except that it will look for "*.*" instead of "*.EXE" when you use
  40. the "Open..." command.  This way you can use it easily to open up
  41. *.C, *.H, *.DEF, and other files.
  42.  
  43. Another tip, if you want to use Notepad for program editing, is to
  44. use the "Associate..." command in the File Manager to associate Notepad
  45. with .C, .H, .DEF and other files that you want to edit with Notepad.
  46.  
  47. And here's where Notepad4 comes in.  Put it in your search path, and
  48. instead of associating Notepad with these program source files, 
  49. associate Notepad4.  Then, if you double-click on a .C file, it will
  50. run Notepad4 before opening your program, and you will get the four
  51. character tab stops in Notepad.
  52.  
  53. One thing should be kept in mind in using Notepad4.  Notepad, whether
  54. started up in the normal mode or through Notepad4, stores tab characters
  55. in the file as actual tabs.  It does not replace them with spaces.  So
  56. if you type "<tab><tab><tab><tab>for (i=0; i<n; ++i)" as a line of code,
  57. that line will be actually stored with four tabs.  Notepad4 will only
  58. show the "for" statement as tabbed in 16 (four times four) spaces.
  59. But if you were to later look at that same file using another editor
  60. which used different tab stops, you will see it indented differently.
  61. In particular, if you later look at it using regular Notepad, you will
  62. see it with 32 spaces of indentation.  The file is no different in
  63. either case, it's just that the tabs are being interpreted differently
  64. by the two programs.
  65.  
  66. This will also have an effect if you look at some code that was written
  67. and indented on the assumption of eight-character tabs.  The sample
  68. programs that come with the Windows SDK are like that.  Although four
  69. character indenting is the style that is generally used, this is done
  70. by a mixture of eight character tab stops and manual typing of four
  71. spaces.  When viewed by Notepad4 with its four character tab stops,
  72. lines are no longer indented properly.  You can get around that by just
  73. using Notepad to look at such old code.
  74.  
  75. Please report any problems with Notepad4 to me.  The program is free and
  76. in the public domain.
  77.  
  78. Hal Finney
  79. Epic Systems Group
  80. Compuserve: [74076,1041]
  81. Internet: hal@symult.com
  82.